package com.gin.xjh.download;

import android.support.annotation.NonNull;
import android.util.Log;

import java.util.regex.Matcher;
import java.util.regex.Pattern;

/**
 * reate by tao on{DATE}
 */
public class Strc {
    public static void main(String[] args) {
        String tt = "sdfdf{fwe }\\//fwef< fwef #$";
        String regEx="[`~!@#$%^&*()+=|{}':;'\\\\.<>/?~！@#￥%……&*（）——+|{}【】'；：”“’。、？]";
        String toSpeechText=tt.replaceAll(regEx,"").trim();
        String dest = toSpeechText.replaceAll("\t|\r|\n|\\s*","");
//        System.err.println("ww正则222==="+dest);
        
       tt= clearSpecialText(tt);
    }

    public static String clearSpecialText(String str) {
        String regEx1 = "[`~!@#$%^&*()+=|{}':;'\\\\.<>/?~！@#￥%……&*（）——+|{}【】'；：”“’。、？]";
        String regex2 = "\t|\r|\n|\\s*";
        return repleaseText(repleaseText(str,regEx1), regex2);
    }


    public static String repleaseText(String str, String regEx) {
        return str.replaceAll(regEx, "").trim();
    }
}
